package com.hqyj.dao;

import com.hqyj.entity.Salary;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SalaryDao extends JpaRepository<Salary,Integer> {

//    @Query(nativeQuery = true,value = "")
    @Query(nativeQuery = true,value = "select * from salary where user_id=:user_id and year =:year ")
    List<Salary> getAllByUser_idAndYear(@Param("user_id") String user_id,@Param("year") String year);
}
